package com.david.dubbo.spi;

import com.david.dubbo.spi.service.DavidService;
import org.apache.dubbo.common.URL;
import org.apache.dubbo.common.extension.ExtensionLoader;

/**
 * @author David
 * @version V1.0
 * @Package com.david.dubbo.spi
 * @date 2021/4/11 16:46
 */
public class MainTest {
    public static void main(String[] args) {
        URL workUrl = URL.valueOf("test://localhost/sss?david.service=work");
        URL learnUrl = URL.valueOf("test://localhost/sss?david.service=learn");
        DavidService workService = ExtensionLoader.getExtensionLoader(DavidService.class).getAdaptiveExtension();
        String s = workService.doSomething(workUrl);
        System.out.println("work动态返回结果：" + s);
        String s1 = workService.doSomething(learnUrl);
        System.out.println("learn动态返回结果 = " + s1);

    }
}
